﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Specialized;
using System.Reflection;

namespace SoftballStats
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

            }
        }

        protected void lnkSamcro_Click(object sender, EventArgs e)
        {
            SoftballStats_BL.Season currentSeason = Session["Season"] as SoftballStats_BL.Season;
            SoftballStats_BL.Team samcro = SoftballStats_BL.Team.GetTeamByNameAndSeasonID("SAMCRO", currentSeason.ID);
            if (samcro.ID != Guid.Empty)
            {
                Session["Team"] = samcro;
            }
            else
            {
                Session["Team"] = null;
            }
            Response.Redirect("TeamPage.aspx");
        }

        protected void lnkHeritage_Click(object sender, EventArgs e)
        {
            SoftballStats_BL.Season currentSeason = Session["Season"] as SoftballStats_BL.Season;
            SoftballStats_BL.Team heritage = SoftballStats_BL.Team.GetTeamByNameAndSeasonID("Heritage Baptist", currentSeason.ID);
            if (heritage.ID != Guid.Empty)
            {
                Session["Team"] = heritage;
            }
            else
            {
                Session["Team"] = null;
            }
            Response.Redirect("TeamPage.aspx");
        }

        protected void lnkBoilers_Click(object sender, EventArgs e)
        {
            SoftballStats_BL.Season currentSeason = Session["Season"] as SoftballStats_BL.Season;
            SoftballStats_BL.Team boilermakers = SoftballStats_BL.Team.GetTeamByNameAndSeasonID("Boilermakers", currentSeason.ID);
            if (boilermakers.ID != Guid.Empty)
            {
                Session["Team"] = boilermakers;
            }
            else
            {
                Session["Team"] = null;
            }
            Response.Redirect("TeamPage.aspx");
        }

        protected void lnkCKBCFri_Click(object sender, EventArgs e)
        {
            SoftballStats_BL.Season currentSeason = Session["Season"] as SoftballStats_BL.Season;
            SoftballStats_BL.Team ckbcFri = SoftballStats_BL.Team.GetTeamByNameAndSeasonID("CKBC", currentSeason.ID);
            if (ckbcFri.ID != Guid.Empty)
            {
                Session["Team"] = ckbcFri;
            }
            else
            {
                Session["Team"] = null;
            }
            Response.Redirect("TeamPage.aspx");
        }

    }
}
